package com.t.bricks.bussiness.db.dao.orders;

import java.util.Date;
import java.util.List;

import com.t.bricks.bussiness.db.dao.common.BaseDao;
import com.t.bricks.bussiness.db.entity.orders.Orders;
import com.t.bricks.bussiness.db.entity.orders.base.OrdersDetailBase;
import com.t.bricks.model.MsgEmity;

public interface OrdersDao<T> extends BaseDao<T> {

	/**
	 * 添加
	 * @Param orders
	 * @return int
	 */
	MsgEmity addCustom(Orders orders);
	
	/**
	 * 查询购物车对应详情
	 * @param cartIds
	 * @param sCustomerId
	 * @return List<OrdersDetailBase>
	 */
	MsgEmity cartToDetail(List<String> cartIds, String sCustomerId);
	
	/**
	 * 设置状态-支付
	 * @param sId
	 * @param sRechargeNo
	 * @param iVersion
	 * @return
	 */
	MsgEmity pay(String sId, String sRechargeNo, Integer iVersion);
	
	/**
	 * 设置状态-销售
	 * @param sId
	 * @param iVersion
	 * @param sSalesmanId
	 * @param sSalesman
	 * @return
	 */
	MsgEmity sales(String sId, Integer iVersion, String sSalesmanId, String sSalesman);
	
	/**
	 * 设置状态-送出(待揽货)
	 * @param sId
	 * @param iVersion
	 * @param dDelivery
	 * @param sDelivery
	 * @param sDeliveryman
	 * @param sDeliveryNo
	 * @param sDelveryCode
	 * @return
	 */
	MsgEmity delivery(String sId, Integer iVersion, Date dDelivery,
			String sDelivery, String sDeliveryman, String sDeliveryNo,
			String sDelveryCode);
	
	/**
	 * 顾客签收
	 * @param sId
	 * @param iVersion
	 * @param sSignIn
	 * @return
	 */
	MsgEmity signIn(String sId, Integer iVersion, String sSignIn);
	
	/**
	 * 顾客确认
	 * @param sId
	 * @param iVersion
	 * @param sConfirm
	 * @return
	 */
	MsgEmity confirm(String sId, Integer iVersion, String sConfirm);
	
	/**
	 * 顾客退货申请
	 * @param sId
	 * @param iVersion
	 * @param sReturnApply 退货申请说明
	 * @return
	 */
	MsgEmity returnApply(String sId, Integer iVersion, String sReturnApply);
	
	/**
	 * 退货审核
	 * 8:退货审核不通过;9:退货申请通过;10:已退款
	 * @param sId
	 * @param iVersion
	 * @param iState
	 * @return
	 */
	MsgEmity untreadAudit(String sId, Integer iVersion, Integer iState);
	
	/**
	 * 设置状态-审核
	 * @param sId
	 * @param iVersion
	 * @param sAuditId
	 * @param sAudit
	 * @return
	 */
	MsgEmity audit(String sId, Integer iVersion, String sAuditId, String sAudit);
	
	/**
	 * 设置状态-复审
	 * @param sId
	 * @param iVersion
	 * @param sRecheckId
	 * @param sRecheck
	 * @return
	 */
	MsgEmity recheck(String sId, Integer iVersion, String sRecheckId, String sRecheck);
	
	/**
	 * 测算商品运费
	 * @param details 订单详情集合
	 * @param sArea 目的地
	 * @return
	 */
	MsgEmity reckonFreight(List<OrdersDetailBase> details, String sArea);
	
	/**
	 * 顾客订单中是否包含已经购买过的限购商品
	 * @Param sOrderId 订单编号
	 * @Param sCustomerId 顾客编号
	 * @return
	 */
	MsgEmity isAstrictBuy(String sOrderId, String sCustomerId);
	
}
